package com.jinjie.model.acitivi.config;

import org.activiti.engine.cfg.ProcessEngineConfigurator;
import org.activiti.engine.impl.cfg.IdGenerator;
import org.activiti.spring.SpringProcessEngineConfiguration;
import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer;
import org.springframework.context.annotation.Configuration;

import java.util.UUID;

/**
 * @program: com.jinjie.model.acitivi.config
 * @Description:
 * @author: Administrator
 * @create: 2025-02-11 15:20
 **/
@Configuration
public class ActivitiConfig implements ProcessEngineConfigurationConfigurer {
    @Override
    public void configure(SpringProcessEngineConfiguration springProcessEngineConfiguration) {
        // 设置ID生成器
        springProcessEngineConfiguration.setIdGenerator(new IdGenerator() {
            @Override
            public String getNextId() {
                return UUID.randomUUID().toString();
            }
        });
    }
}
